package com.googlecode.monitoring.flash.model;

import com.googlecode.monitoring.model.EventTime;
import com.googlecode.monitoring.model.ItemToCheck;
import com.googlecode.monitoring.model.Person;
import com.googlecode.monitoring.model.StateName;

import java.util.Set;

public class FlashItemToCheck extends ItemToCheck {

    private String url;


    public FlashItemToCheck(String id, String name, String url, EventTime eventTime, Set<Person> responsiblePerson, String descr, StateName currentStateName) {
        this.setId(id);
        this.setName(name);
        this.url = url;
        this.eventTime = eventTime;
        this.responsiblePersons = responsiblePerson;
        this.descr = descr;
        this.currentStateName = currentStateName;
    }

    public FlashItemToCheck() {
        super();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof FlashItemToCheck)) return false;

        FlashItemToCheck that = (FlashItemToCheck) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id.hashCode();
        result = 31 * result + name.hashCode();
        return result;
    }

}
